const mongoose = require('mongoose');

const userSchema = new mongoose.Schema({
    username: String,
    password: String
})

userSchema.statics.findByName = function(name, cb) {
    this.find({ username: name }, cb);
}

const  User = mongoose.model('User', userSchema);

module.exports = User;